package movie.mapper;

import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import movie.pojo.User;

/**
 * 本类用来演示: Mapper - insert
 *
 * @author: success
 * @date: 2021/6/17 1:51 下午
 */
@SpringBootTest
public class UserMapperZhuce {
    @Autowired
    private UserMapper userMapper;

    /**
     * 测试保存操作...
     */
    @Test
    public void zhuce(){
        //通过new关键字来创建对象
        User user = new User();

        //id是不需要设置的,id构建表的时候auto_increment 自增长的.
        //数据库表中id必须保证唯一性.
        user.setUsername("德比");
        user.setPassword("123");
        user.setEmail("1772690726@qq.com");
        user.setAge(21);
        user.setPower(1);

        userMapper.insert(user);
    }

}
